package comparator;

import com.xjtu.trade.pojo.Product;

import java.util.Comparator;

public class ProductSaleCountComparator implements Comparator<Product> {

    @Override
    public int compare(Product p1, Product p2) {
        // 销售量降序排列
        return p2.getSaleCount() - p1.getSaleCount();
    }
}
